package net.huashitong.common.service;

import com.sirdc.modules.core.dao.BaseDao;
import com.sirdc.modules.sys.base.StringPKService;
import com.sirdc.modules.sys.service.SysTableService;
import net.huashitong.common.dao.SysMessageDao;
import net.huashitong.common.entity.SysMessage;
import net.huashitong.common.filter.SysMessageFilter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class SysMessageService extends StringPKService<SysMessage> {
    @Autowired
    private SysMessageDao sysMessageDao;
    @Autowired
    private SysTableService tableService;
    @Override
    protected BaseDao<SysMessage, String> getDao() {
        return sysMessageDao;
    }

    @Override
    protected void beforeSave(SysMessage obj) {
        obj.setSysId(tableService.updateMaxSysId("t_common_sms", null));
    }

    public List<SysMessage> queryByFilter(SysMessageFilter filter) {
        return sysMessageDao.queryByFilter(filter);
    }

    public List<SysMessage> querySendList(){
        return sysMessageDao.querySendList();
    }
}
